package org.fing.edu.uy.esbadp.core.entity;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;

import org.fing.edu.uy.esbadp.core.constants.ConfigConstants;

@XmlRootElement(name = ConfigConstants.EVENTS_ROOT_ELEMENT)
@XmlSeeAlso({DMAdpEvent.class})
public class DMAdpEvents implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	List<DMAdpEvent> events;
	
	public DMAdpEvents(){
		this.events = new LinkedList<DMAdpEvent>();		
	}

	@XmlElementRef
	public List<DMAdpEvent> getEvents() {
		return events;
	}

	public void setEvents(List<DMAdpEvent> events) {
		this.events = events;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("Adaptation Events ->\n");
		for(DMAdpEvent aux : events){
			sb.append(aux.toString());
			sb.append("\n");
		}
		return sb.toString();
	}
}
